//
//  UIView+ZLFframe.swift
//  ZLFXYF_Swift
//
//  Created by zluof on 16/12/5.
//  Copyright © 2016年 zluof. All rights reserved.
//

import Foundation
import UIKit

extension UIView{
   
   public var x : CGFloat{
        get{
            return self.frame.origin.x
        }
        set{
            var frameView = self.frame
            frameView.origin.x = x
            self.frame = frameView
        }
    }
    
    public var y : CGFloat{
        get{
            return self.frame.origin.y
        }
        set{
            var frameView = self.frame
            frameView.origin.y = y
            self.frame = frameView
        }
    }
    
    public var width : CGFloat{
        get{
            return self.frame.size.width
        }
        set{
            var frameView = self.frame
            frameView.size.width = width
            self.frame = frameView
        }
    }
    public var height : CGFloat{
        get{
            return self.frame.size.height
        }
        set{
            var frameView = self.frame
            frameView.size.height = height
            self.frame = frameView
        }
    }

    public var centerX : CGFloat{
        get{
            return self.center.x
        }
        set{
            var frameView = self.center
            frameView.x = centerX
             self.center = frameView
        }
    }
    public var centerY : CGFloat{
        get{
            return self.center.y
        }
        set{
            var frameView = self.center
            frameView.y = centerY
            self.center = frameView
        }
    }


}